

//
//  HMUser.m
//  黑马微博-wzy
//
//  Created by Mac on 2017/2/9.
//  Copyright © 2017年 Mac. All rights reserved.
//

#import "HMUser.h"

@implementation HMUser

//+ (instancetype)userWithDic:(NSDictionary *)dict{
//
//    HMUser *user = [[self alloc] init];
//    //名称
//    user.name = dict[@"name"];
//    //头像
//    user.profile_image_url = dict[@"profile_image_url"];
//
//    return user;
//}

//+ (NSArray*)parseResondsData:(id)respondObject
//{
//    NSMutableArray *modelArray = [NSMutableArray array];
//    for (NSDictionary *dic  in respondObject) {
//        HMUser *model = [[HMUser alloc]initWithDictionary:dic error:nil];
//        [modelArray addObject:model];
//    }
//    return modelArray;
//}

- (id)initWithDictionary:(NSDictionary*)dic
{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+(JSONKeyMapper*)keyMapper
{
    return [[JSONKeyMapper alloc] initWithDictionary:@{
                                                       @"id": @"user_id"
                                                       }];
}

- (BOOL)isVip{
    //是会员
    return self.mbtype > 2;
}


@end
